#!/usr/bin/env python3
import sys
import os
import logging

# 添加项目路径
sys.path.append(os.path.dirname(os.path.abspath(__file__)))

from scheduler import ReminderScheduler


def main():
    """主函数"""
    try:
        # 创建调度器实例并启动
        scheduler = ReminderScheduler()
        scheduler.start()

    except KeyboardInterrupt:
        logging.info("服务被用户中断")
    except Exception as e:
        logging.error(f"服务异常: {e}")
        sys.exit(1)


if __name__ == "__main__":
    main()